package com.koicarp.university.graduate.web.controller;


import com.koicarp.university.graduate.service.dao.GraduateStatusDao;
import com.koicarp.university.graduate.service.entity.graduateInfoManage.GraduateStatus;
import com.koicarp.university.graduate.service.service.graduateInfoManage.IGraduateStatusService;
import com.koicarp.university.graduate.service.service.graduateInfoManage.impl.GraduateStatusServiceImpl;
import com.koicarp.university.graudate.common.constant.BaseConstant;
import com.koicarp.university.graudate.common.utils.UniversityResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 【毕业生管理：毕业状态表(档案，就业状态)】(GraduateStatus_old)表控制层
 *
 * @author liutao
 * @since 2020-09-03 19:53:52
 */
@RestController
@RequestMapping("graduateStatus")
@Slf4j
@RequiredArgsConstructor
@Api(tags = "(毕业状态表)控制层")
public class GraduateStatusController {

    private final IGraduateStatusService graduateStatusService;

    @PostMapping("getStatusById")
    @ApiOperation(value = "根据id查找毕业生状态",notes = "根据id查找毕业生状态")
    public UniversityResponse getStatusById(@RequestBody GraduateStatus graduateStatus){
        UniversityResponse response=null;
        try{
            response = graduateStatusService.queryById(graduateStatus.getId());
        }catch (Exception e){
            log.error("修改失败",e);
            response = new UniversityResponse();
            response.code(BaseConstant.RESPONSE_CODE_FAILED_500);
            response.message(BaseConstant.RESPONSE_MESSAGE_OPR_FAILED);
        }
        return response;
    }
}